package DesignMode.Single;

/**
 * @author VX5
 * @Title: MJC
 * @ProjectName DataStructure
 * @Description: TODO
 * @date ${DAT}20:57
 */
public class Singleton3 {//静态内部类 通过类装载机制来保证
    private Singleton3() {
    }

    private static class SingletonInstance{
        private static final Singleton3 instacne = new Singleton3();
    }

    public static synchronized Singleton3 getInstance(){
        return SingletonInstance.instacne;
    }
}
